<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="Generator" content="EditPlus®">
    <meta name="Author" content="">
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
    <meta name="renderer" content="webkit">
    <title>一级分类</title>
    <link rel="shortcut icon" type="image/x-icon" th:href="@{/myFile/imgold/icon/favicon.ico}">
    <link rel="stylesheet" type="text/css" th:href="@{/theme/css/base.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/theme/css/home.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/layui/css/layui.css}">
    <script type="text/javascript" th:src="@{/theme/js/jquery.js}"></script>
    <script type="text/javascript" th:src="@{/layui/layui.all.js}"></script>
    <script type="text/javascript" th:src="@{/theme/js/delCartOnPages.js}"></script>
    <script type="text/javascript" th:src="@{/theme/js/searchToPage.js}"></script>
    <script type="text/javascript" th:src="@{/theme/js/paging.js}"></script>
    <script>
        function toFirstTypePage(categoryId) {
            window.location = "/firstType?categoryId=" + categoryId + "&pageNum=1&pageSize=16";
        }

        $(document).ready(function () {
            var data = $("#cartIdNull").val();
            $("#test").mouseover(function () {
                if (data == 'notNull') {
                    layer.open({
                        type: 2,
                        title: '我的购物车',
                        shadeClose: true,
                        area: ['19%', '60%'],
                        offset: ['9%', '76%'],
                        content: '/cart?pageNum=1&pageSize=100', //iframe的url
                    });
                } else {
                    layer.open({
                        type: 2,
                        title: '我的购物车',
                        shadeClose: true,
                        area: ['20%', '20%'],
                        offset: ['9%', '76%'],
                        content: '/cart?pageNum=1&pageSize=100', //iframe的url
                    });
                }
            });

        });

        function logout() {
            $.ajax({
                url: "/user/logout",
                dataType: "json",
                data: {},
                async: false,
                success: function (data) {
                    if (data["result"] == "ok") {
                        layer.msg('退出成功', {time: 1000}, function () {
                            window.location = "index";
                        });
                    } else if (data["result"] == "fail") {
                        layer.msg('您还没有登录哦~', {time: 1000}, function () {
                            window.location.reload();
                        });
                    }
                },
                type: "post"
            });
        }
        (function (a) {
            a.fn.hoverClass = function (b) {
                var a = this;
                a.each(function (c) {
                    a.eq(c).hover(function () {
                        $(this).addClass(b)
                    }, function () {
                        $(this).removeClass(b)
                    })
                });
                return a
            };
        })(jQuery);

        $(function () {
            $("#pc-nav").hoverClass("current");
        });
        function collectOne(commodityId) {
            $.ajax({
                url: "/collect/addByCommodityIdCollect",
                dataType: "json",
                data: {"commodityId": commodityId},
                async: false,
                success: function (data) {
                    if (data["result"] == "ok") {
                        layer.msg('收藏成功', {time: 1000}, function () {
                            window.location.reload();
                        });
                    } else if (data["result"] == "fail") {
                        layer.msg('收藏失败', {time: 1000}, function () {
                            window.location.reload();
                        });
                    } else if (data["result"] == "noSession") {
                        layer.msg('登录失效，请重新登录', {time: 1000}, function () {
                            window.location = "login";
                        });
                    } else if (data["result"] == "exit") {
                        layer.msg('该商品已经在您的收藏夹里了哦~', {time: 1000}, function () {
                        });
                    } else {
                        layer.msg('系统错误', {time: 1000}, function () {
                            window.location.reload();
                        });
                    }
                },
                type: "post"
            });
        }

    </script>
    <style>
        .menu_body a:hover{text-decoration:none;color: #a90000;}
    </style>
</head>
<body>

<input type="hidden" id="cartIdNull" th:value="${session.cartIsNull}">
<!--- header begin-->
<header id="pc-header">
    <div class="BHeader">
        <div class="yNavIndex">
            <ul class="BHeaderl">
                <li><a th:if="${session.userId}==null" th:href="@{/login}">请登录</a></li>
                <li class="headerul" th:if="${session.userId}==null">|</li>
                <li><a th:if="${session.userId}==null" th:href="@{/register}">免费注册</a></li>
                <li class="headerul" th:if="${session.userId}==null">|</li>
                <li><a th:href="@{/myOrder?pageNum=1&pageSize=5}" th:if="${session.userId}!=null">我的订单</a></li>
                <li class="headerul" th:if="${session.userId}!=null">|</li>
                <li><a th:href="@{/myCollect?pageNum=1&pageSize=8}" th:if="${session.userId}!=null">我的收藏</a></li>
                <li class="headerul" th:if="${session.userId}!=null">|</li>
                <li id="pc-nav" class="menu" th:if="${session.userId}!=null"><a th:href="@{#}" class="tit">我的淘淘</a>
                    <div class="subnav">
                        <a th:href="@{/accountSecurity}">账户安全</a>
                        <a th:href="@{/myAddress}">地址管理</a>
                        <a th:href="@{/myEvaluate?pageNum=1&pageSize=5}">我的评价</a> <a th:href="@{/viewHistory?pageNum=1&pageSize=5}">浏览记录</a>
                    </div>
                </li>
                <li class="headerul" th:if="${session.userId}!=null">|</li>
                <li th:if="${session.userId}!=null">
                    <a th:text="${session.userName}"></a>
                </li>
                <li th:if="${session.userId}!=null">
                    <img th:src="'/myFile/img/userHeadPic/'+${session.userHead}+''"
                         onclick="javascript:window.location='myInfo'" style=" width:30px;height:30px;">
                    <a href="javascript:logout()" style="float: right;">退出</a>
                </li>
            </ul>
        </div>
    </div>
    <div class="container clearfix" style="padding:20px 0 20px ">
        <div class="header-logo fl"><h1><a th:href="@{/index}" style="color:#ea4949;">
            <img th:src="@{/myFile/imgold/icon/logo1.png}" style="width:100px;height:80px;"><strong>淘淘商城</strong></a>
        </h1>
        </div>
        <div class="head-form fl">
            <form class="clearfix">
                <input type="text" class="search-text" id="searchKey" autocomplete="off" placeholder="手机">
                <button type="button" class="button" onclick="searchToPage();">搜索</button>
            </form>
            <div class="words-text clearfix">
                <a th:href="@{/#}" class="red">1元秒爆</a>
                <a th:href="@{/#}">低至五折</a>
                <a th:href="@{/#}">农用物资</a>
                <a th:href="@{/#}">买一赠一</a>
                <a th:href="@{/#}">佳能相机</a>
                <a th:href="@{/#}">稻香村月饼</a>
                <a th:href="@{/#}">服装城</a>
            </div>
        </div>
        <div class="header-cart fr" th:if="${session.userId}!=null">
            <a  th:href="@{/myCart}" target="_blank"
                style="height:30px;width:30px;float:right;margin-right:50px;"><img
                    id="test" src="../myFile/imgold/icon/car.png"></a>
            <i th:if="${session.cartIsNull}=='notNull'" class="head-amount" id="cartCountExist" th:text="${session.cartAllCount}"></i>
            <i th:if="${session.cartIsNull}=='null'" class="head-amount" id="cartCountUnExist">0</i>
        </div>
    </div>
    <div class="yHeader">
        <div class="yNavIndex">
            <div class="pullDown">
                <h2 class="pullDownTitle">全部商品分类</h2>
            </div>
            <ul class="yMenuIndex">
                <li><a href="/home1" target="_blank">服装城</a></li>
                <li><a href="#" >美妆馆</a></li>
                <li><a href="#" >乐享美食</a></li>
                <li><a href="#" >品质生活</a></li>
                <li><a href="#" >智能家电</a></li>
            </ul>
        </div>
    </div>
</header>
<!-- header End -->
<div class="containers">
    <div class="pc-nav-item"><a href="/#" >全部分类 </a> &gt;<a href="#" th:text="${catetoryName}"></a>
    </div>
</div>

<div class="containers clearfix">
    <div class="fl" style="border:1px solid #e0e0e0" >
        <div id="firstpane" class="menu_list">
            <h2>全部分类</h2>
            <div class="menu_body" th:each="acs:${allCategories}">
                    <a style="float:left;border-bottom:none;"th:href="'javascript:toFirstTypePage('+${acs.id}+')'"><span th:text="${acs.name}"></span></a></li>
            </div>
        </div>
    </div>
    <div class="pc-info fr">
        <div class="pc-term">
            <div class="pc-nav-rack clearfix">
                <span th:text="${catetoryName}"></span>
            </div>
            <div class="time-border-list pc-search-list clearfix" style="padding:20px;">
                <ul class="clearfix">
                    <li style="padding:10px;"th:each="com : ${commodities}">
                        <a th:href="'/commodityInfo?commodityId='+${com.id}+''">
                            <img th:src="'/myFile/img/commodityPic/'+${com.comPicture}+''"
                                 style="width:160px;height:170px;padding:10px">
                        </a>
                        <p class="head-name" style="height:0;"><a th:href="'/commodityInfo?commodityId='+${com.id}+''"><div style="width:200px;overflow:hidden;text-overflow:ellipsis; white-space:nowrap;"
                                                                                                                              th:text="${com.name}"></div></a>
                        </p>
                        <p class="price" style="margin-top:10px;"><span>￥<span class="comPrice"
                                                                                                 th:text="${com.comPrice}"></span></span>
                        </p>
                        <p class="clearfix"><a class="label-default fl"
                                               th:href="'/commodityInfo?commodityId='+${com.id}+''">抢购</a>
                            <a th:href="'javascript:collectOne('+${com.id}+')'" class="fr pc-search-c">收藏</a>
                        </p>
                    </li>
                </ul>
            </div>
        </div>
        <div class="fr pc-search-v">
            <div class="pc-search-i"style="background: #fff">
                <div class=" fr">
                    <a th:href="'javascript:upPage(\'firstType?categoryId='+${categoryId}+'&\','+${pageNum}+','+${pageSize}+')'"
                       style="background:url(/myFile/imgold/icon/s-a3.png) no-repeat left;color:#ea4949;">上一页</a>
                    <span class="pc-search-t">
                        <input type="text" style="width:50px;height:22px" id="inputpageNum2" th:value="${pageNum}">
                        <em>/</em>
                        <i th:text="${commodityPageCount}"></i>
                    </span>
                    <a th:href="'javascript:toPage(\'firstType?categoryId='+${categoryId}+'&\','+${pageNum}+','+${pageSize}+','+${commodityPageCount}+',\'inputpageNum2\')'"
                       style="background: none">go</a>
                    <a th:href="'javascript:nextPage(\'firstType?categoryId='+${categoryId}+'&\','+${pageNum}+','+${pageSize}+','+${commodityPageCount}+')'"
                       style="color:#ea4949;">下一页</a>
                </div>
            </div>
        </div>

    </div>

</div>
<div style="height:100px;"></div>
<!--- footer begin-->
<div class="aui-footer-bot">
    <div class="time-lists aui-footer-pd clearfix">
        <div class="aui-footer-list clearfix">
            <h4>
                <span><img th:src="@{/myFile/imgold/icon/icon-d1.png}"></span>
                <em>消费者权益</em>
            </h4>
            <ul>
                <li><a th:href="@{/#}">保障范围 </a></li>
                <li><a th:href="@{/#}">退货退款流程</a></li>
                <li><a th:href="@{/#}">服务中心 </a></li>
                <li><a th:href="@{/#}">服务中心</a></li>
                <li><a th:href="@{/#}"> 更多特色服务 </a></li>
            </ul>
        </div>
        <div class="aui-footer-list clearfix">
            <h4>
                <span><img th:src="@{/myFile/imgold/icon/icon-d2.png}"></span>
                <em>新手上路</em>
            </h4>
            <ul>
                <li><a th:href="@{/#}">退货退款流程</a></li>
                <li><a th:href="@{/#}">服务中心 </a></li>
                <li><a th:href="@{/#}">服务中心</a></li>
                <li><a th:href="@{/#}"> 更多特色服务 </a></li>
            </ul>
        </div>
        <div class="aui-footer-list clearfix">
            <h4>
                <span><img th:src="@{/myFile/imgold/icon/icon-d3.png}"></span>
                <em>保障正品</em>
            </h4>
            <ul>
                <li><a th:href="@{/#}">退货退款流程</a></li>
                <li><a th:href="@{/#}">服务中心 </a></li>
                <li><a th:href="@{/#}">服务中心</a></li>
                <li><a th:href="@{/#}"> 更多特色服务 </a></li>
            </ul>
        </div>
        <div class="aui-footer-list clearfix">
            <h4>
                <span><img th:src="@{/myFile/imgold/icon/icon-d1.png}"></span>
                <em>消费者权益</em>
            </h4>
            <ul>
                <li><a th:href="@{/#}">退货退款流程</a></li>
                <li><a th:href="@{/#}">服务中心 </a></li>
                <li><a th:href="@{/#}">服务中心</a></li>
                <li><a th:href="@{/#}"> 更多特色服务 </a></li>
            </ul>
        </div>
    </div>
    <div style="border-bottom:1px solid #dedede"></div>
    <div class="time-lists aui-footer-pd time-lists-ls clearfix">
        <div class="aui-footer-list clearfix">
            <h4>购物指南</h4>
            <ul>
                <li><a th:href="@{/#}">保障范围 </a></li>
                <li><a th:href="@{/#}">购物流程</a></li>
                <li><a th:href="@{/#}">会员介绍 </a></li>
                <li><a th:href="@{/#}">生活旅行</a></li>
                <li><a th:href="@{/#}"> 常见问题 </a></li>
                <li><a th:href="@{/#}"> 联系客服购物指南 </a></li>
            </ul>
        </div>
        <div class="aui-footer-list clearfix">
            <h4>特色服务</h4>
            <ul>
                <li><a th:href="@{/#}">退货退款流程</a></li>
                <li><a th:href="@{/#}">服务中心 </a></li>
                <li><a th:href="@{/#}">服务中心</a></li>
                <li><a th:href="@{/#}"> 更多特色服务 </a></li>
                <li><a th:href="@{/#}"> 更多特色服务 </a></li>
                <li><a th:href="@{/#}"> 更多特色服务 </a></li>
                <li><a th:href="@{/#}"> 更多特色服务 </a></li>
            </ul>
        </div>
        <div class="aui-footer-list clearfix">
            <h4>帮助中心</h4>
            <ul>
                <li><a th:href="@{/#}">退货退款流程</a></li>
                <li><a th:href="@{/#}">退货退款流程</a></li>
                <li><a th:href="@{/#}">退货退款流程</a></li>
                <li><a th:href="@{/#}">退货退款流程</a></li>
                <li><a th:href="@{/#}">服务中心 </a></li>
                <li><a th:href="@{/#}">服务中心</a></li>
                <li><a th:href="@{/#}"> 更多特色服务 </a></li>
            </ul>
        </div>
        <div class="aui-footer-list clearfix">
            <h4>新手指导</h4>
            <ul>
                <li><a th:href="@{/#}">退货退款流程</a></li>
                <li><a th:href="@{/#}">退货退款流程</a></li>
                <li><a th:href="@{/#}">服务中心 </a></li>
                <li><a th:href="@{/#}">服务中心</a></li>
                <li><a th:href="@{/#}">服务中心</a></li>
                <li><a th:href="@{/#}"> 更多特色服务 </a></li>
                <li><a th:href="@{/#}"> 更多特色服务 </a></li>
            </ul>
        </div>
    </div>
</div>

<!-- footer End -->
</body>
</html>